﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace iTelluro.Explorer.Domain.Seedwork
{
    public interface IUnitOfWork
        :IDisposable
    {
        /// <summary>
        /// Commit all changes made in a container.
        /// </summary>
        /// <remarks>
        /// If the entity have fixed properties and any optimistic concurrency problem exists
        /// then an exception is thrown.
        /// </remarks>
        void Commit();

        /// <summary>
        /// Commit all changes made in a container.
        /// </summar>
        /// <remarks>
        /// if the Entity have fixed properties and any optimistic concurrency problem exists,
        /// then 'client changes' are refreshed - Client wins.
        /// </remarks>
        void CommitAndRefreshChanges();

        /// <summary>
        /// Rollback tracked changes.see refrence of unitofwork pattern.
        /// </summary>
        void RollbackChanges();
    }
}
